package cmpe451.group7.ourcity.dao;

import java.util.Date;
import java.util.List;

import cmpe451.group7.ourcity.entity.Place;
import cmpe451.group7.ourcity.entity.Tag;
import cmpe451.group7.ourcity.entity.User;

/**
 * Interface for place DAO objects.
 * 
 */
public interface PlaceDAO extends GenericDAO<Place> {

	/**
	 * Add a new place with the given values.
	 * 
	 * @param placeName
	 * @param country
	 * @param city
	 * @param likeCount
	 * @param latitude
	 * @param longitude
	 * @param creationDate
	 */
	Place insertNewPlace(String placeName, String country, String city,
			int likeCount, double latitude, double longitude,
			Date creationDate, List<Tag> tags, User user);

	/**
	 * Query the database with the given equality restrictions.
	 * 
	 * For tags, place should contain at least all of the tags.
	 * 
	 * @param placeName
	 * @param country
	 * @param city
	 * @param latitude
	 * @param longitude
	 * @param fromDate
	 * @param toDate
	 * @param tags
	 * @return Returns null for error cases.
	 */
	List<Place> findByRestrictions(String placeName, String country,
			String city, Date fromDate, Date toDate, List<Tag> tags);

	Place incrementLikeCount(Place place, boolean liked);

	List<Place> findByRestrictions(String placeName, String country,
			String city, Date fromDate, Date toDate, List<Tag> selectedTags,
			double ne_lat, double ne_lng, double sw_lat, double sw_lng);

	List<Place> getRelatedPlaces(List<Tag> tags);

	int getNumberOfUserPlaces(User user);

}
